<?php

/**
 * This is the model class for table "content_base".
 *
 * The followings are the available columns in table 'content_base':
 * @property integer $id ID
 * @property string $short_title Short Title
 * @property string $title Title
 * @property string $thumb Thumb
 */
class ContentBase extends ActiveRecord
{
	/**
	 * Returns the static model of the specified AR class.
	 * @return ContentBase the static model class
	 */
	public static function model($className=__CLASS__) {
		return parent::model($className);
	}
	
	public function getMdcClass() {
		return 'application.models.metadata.ContentBaseMetadata';
	}
	
	protected function beforeSave() {
		if ($this->hasAttribute('is_recommend') && $this->isNewRecord) {
			$this->is_recommend = empty($this->is_recommend) ? 0 : $this->is_recommend;
		}
		return parent::beforeSave();
	}
}